package com.jrzh.db.migration.sys;

import com.jrzh.framework.migration.BaseMigration;
import com.jrzh.framework.migration.MigrationHelper;

/**
 * 添加邮件发送表
 * @author Mr.Shower
 *
 */
public class Migration_9 extends BaseMigration{
	private static final String TABLE_NAME_ONE = "sys_email_send";
	private static final String TABLE_NAME_TWO = "sys_email_sending";
	
	@Override
	public void down() {
		MigrationHelper.dropTable(TABLE_NAME_ONE);
		MigrationHelper.dropTable(TABLE_NAME_TWO);
	}

	@Override
	public void up() {
		log.info("##########执行Sys模块 Migration_9##########Begin");
		table(TABLE_NAME_ONE, "邮件发送历史表", true, 
				pk(),
				jrVarchar("_email", "邮箱地址", 256),
				jrVarchar("_title", "邮件标题", 512),
				jrText("_body", "邮件内容"),
				jrVarchar("_is_sent", "是否已经发送 T：是  F：否", 10),
				jrInt("_try_times", "尝试发送次数"),
				jrText("_file_ids", "附件文件ID串,分隔")
		);
		
		table(TABLE_NAME_TWO, "邮件发送表", true, 
				pk(),
				jrVarchar("_email", "邮箱地址", 256),
				jrVarchar("_title", "邮件标题", 512),
				jrText("_body", "邮件内容"),
				jrVarchar("_is_sent", "是否已经发送 T：是  F：否", 10),
				jrInt("_try_times", "尝试发送次数"),
				jrText("_file_ids", "附件文件ID串,分隔")
		);
		log.info("##########执行Sys模块 Migration_9##########End");
	}
}
